//
//  CHSAppDelegate.m
//  ZXLoginKit
//
//  Created by 海参 on 10/09/2022.
//  Copyright (c) 2022 海参. All rights reserved.
//

#import "CHSAppDelegate.h"
#import <UMCommon/UMCommon.h>
#import <ZXLoginKit/ZXLoginKit.h>
#import <UMVerify/UMVerify.h>

#define APPKEY_UM          @"5e1d2899570df39191000065"

///一键登录
#define ATAUTH_SDK_INFO_UM @"jF8Zvi+PycXg4ZvElY1L99gu49WgwSWdn79Qa7oiqIqn6ljBRvBe9l1CRdQqhCEgVPVu8n2XPlgpqsAtQsMO1XhMHoMFvKWgv7irlfQGdqrnQFY7rs595ID/id/SVwKKe5yHPmFc0+nRl2/iLvzM/tk2pRw6UVnpe5EcO9+LeYgVM9JYIiHGtxFL8haG5Gyt8q6jsxMZZjlqQxQrXt8dGs4y8UOVmQP09WQNKEnIqfswUTjDCVvIdpNFTrxDWT0zh6Y/jG5UFm+AIndkFYYSdQ=="

@implementation CHSAppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // Override point for customization after application launch.
    [UMConfigure initWithAppkey:APPKEY_UM channel:@"App Store"];
    __weak typeof(self) weakSelf =self;
    //设置SDK参数，app生命周期内调用一次即可
    [[ZXLoginAPI sharedInstance]initOneKeyLoginAuth:ATAUTH_SDK_INFO_UM];
//    [UMCommonHandler setVerifySDKInfo:ATAUTH_SDK_INFO_UM complete:^(NSDictionary*_Nonnull resultDic){
//        NSString *resultCode = [resultDic objectForKey:@"resultCode"];
//        if([resultCode isEqualToString:PNSCodeSuccess]){
//            [UMCommonHandler accelerateLoginPageWithTimeout:3 complete:^(NSDictionary*_Nonnull resultDic){
//                NSString *resultCode2 = [resultDic objectForKey:@"resultCode"];
//                if([resultCode2 isEqualToString:PNSCodeSuccess]){
//
//                }
//            }];
//        }
//    }];
    return YES;
}

- (void)applicationWillResignActive:(UIApplication *)application
{
    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
    // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}

- (void)applicationDidEnterBackground:(UIApplication *)application
{
    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

- (void)applicationWillEnterForeground:(UIApplication *)application
{
    // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}

- (void)applicationDidBecomeActive:(UIApplication *)application
{
    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

- (void)applicationWillTerminate:(UIApplication *)application
{
    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

@end
